package com.moon.common.utils.criteria;

import java.util.HashMap;
import java.util.List;

public class Criteria {
	
    private List<Expression> expressions;
    private HashMap<String,Object> params;
    private String ql;
    
    public boolean addExpression(Expression exp){
    	return expressions.add(exp);
    }
    
    public boolean removeExpression(Expression exp){
    	return expressions.remove(exp);
    }
	
	public HashMap<String, Object> getParams() {
		for(Expression exp:expressions){
			params.put(exp.getPropertyName(),exp.getValue());
		}
		return params;
	}
	
	public String getQl() {
		return ql;
	}
	
}
